#!/bin/bash

if [ -d "../build" ];then
    rm ../build -rf
    mkdir ../build
fi

cd ../build

cmake ../ecg_server_pro/ -DINSTALL_HEAD_FILE_ONLY=YES

echo "cmake run over"

if [ ! -z $? ];then
    make 
    if [ ! -z $? ];then
        make install
    fi
fi

cmake ../ecg_server_pro/ -DINSTALL_HEAD_FILE_ONLY=NO
if [ ! -z $? ];then
    make install
else
    echo "Make failed..."
fi







